import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '指标类型',
    align:"center",
    dataIndex: 'indextype_dictText',
     width:200
   },
   {
    title: '考核指标',
    align:"center",
    dataIndex: 'assessindex',
     width:250
   },
   {
    title: '权重',
    align:"center",
    dataIndex: 'weight',
     width:50
   },
   {
    title: '指标定义及公式',
    align:"center",
    dataIndex: 'indexdefineandtime',
     width:250
   },
   {
    title: '评价细则',
    align:"center",
    dataIndex: 'commentrules',
     width:250
   },
   {
    title: '责任部门',
    align:"center",
    dataIndex: 'respondepartment_dictText'
   },
   {
    title: '基本目标值',
    align:"center",
    dataIndex: 'basetargetvalue',
     width:70
   },
   {
    title: '激励目标值',
    align:"center",
    dataIndex: 'motivatetargetvalue',
     width:70
   },
   {
    title: '配合部门',
    align:"center",
    dataIndex: 'coopDepart_dictText'
   },
  {
    title:'任务状态',
    align:"center",
    dataIndex: 'taskstatus'
  },{
  title:'主管/配合',
    align:"center",
    dataIndex: 'leader'
  }
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '指标类型',
    field: 'indextype',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"index_type"
     },
  },
  {
    label: '考核指标',
    field: 'assessindex',
    component: 'Input',
  },
  {
    label: '权重',
    field: 'weight',
    component: 'Input',
  },
  {
    label: '指标定义及公式',
    field: 'indexdefineandtime',
    component: 'Input',
  },
  {
    label: '评价细则',
    field: 'commentrules',
    component: 'Input',
  },
  {
    label: '责任部门',
    field: 'respondepartment',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sys_depart,depart_name,id"
     },
      dynamicDisabled:true
  },
  {
    label: '基本目标值',
    field: 'basetargetvalue',
    component: 'Input',
  },
  {
    label: '激励目标值',
    field: 'motivatetargetvalue',
    component: 'Input',
  },
  {
    label: '待办完成时间',
    field: 'tobedoneFinishedtime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '配合部门',
    field: 'coopDepart',
    component: 'JSelectMultiple',
    componentProps:{
        dictCode:"sys_depart where depart_name like '%部' or depart_name like '%处',depart_name,id"
     },
  },
  {
    label: '驳回情况',
    field: 'refusestatus',
    component: 'Input',
  },
  {
    label: '任务状态',
    field: 'taskstatus',
    component: 'Input',
  },
  {
    label: '主管/配合',
    field: 'leader',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  indextype: {title: '指标类型',order: 0,view: 'list', type: 'string',dictCode: 'index_type',},
  assessindex: {title: '考核指标',order: 1,view: 'text', type: 'string',},
  weight: {title: '权重',order: 2,view: 'text', type: 'string',},
  indexdefineandtime: {title: '指标定义及公式',order: 3,view: 'text', type: 'string',},
  commentrules: {title: '评价细则',order: 4,view: 'text', type: 'string',},
  respondepartment: {title: '责任部门',order: 5,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'id', dictText: 'depart_name',},
  basetargetvalue: {title: '基本目标值',order: 6,view: 'text', type: 'string',},
  motivatetargetvalue: {title: '激励目标值',order: 7,view: 'text', type: 'string',},
  tobedoneFinishedtime: {title: '待办完成时间',order: 8,view: 'datetime', type: 'string',},
  coopDepart: {title: '配合部门',order: 9,view: 'list_multi', type: 'string',dictTable: "sys_depart where depart_name like '%部' or depart_name like '%处'", dictCode: 'id', dictText: 'depart_name',},
  refusestatus: {title: '驳回情况',order: 10,view: 'text', type: 'string',},
  taskstatus: {title: '任务状态',order: 11,view: 'text', type: 'string',dictCode: 'taskstatus',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
